(utf-8-post-read-conversion): If the
authorKenichi Handa <handa@m17n.org>
Fri, 27 Aug 2004 00:24:50 +0000 (00:24 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 27 Aug 2004 00:24:50 +0000 (00:24 +0000)
buffer is unibyte, temporarily set it multibyte.

lisp/international/utf-8.el

index bad79b58743178a95c02e64b531af6c09126b7dd..5a7acee0f0e929264320ca7d801731b0a0416882 100644 (file)
@@ -870,7 +870,9 @@ Also compose particular scripts if `utf-8-compose-scripts' is non-nil."
       ;; version of the string in the loop, since it's always loaded as
       ;; unibyte from a byte-compiled file.
       (let ((range (string-as-multibyte "^\xc0-\xc3\xe1-\xf7"))
+           (buffer-multibyte enable-multibyte-characters)
            hash-table ch)
+       (set-buffer-multibyte t)
        (when utf-translate-cjk-mode
          (if (not utf-translate-cjk-lang-env)
              ;; Check these characters:
@@ -893,7 +895,9 @@ Also compose particular scripts if `utf-8-compose-scripts' is non-nil."
                (progn
                  (insert ch)
                  (delete-char 1))
-             (forward-char 1)))))
+             (forward-char 1))))
+       (or buffer-multibyte
+           (set-buffer-multibyte nil)))
 
       (when (and utf-8-compose-scripts (> length 1))
        ;; These currently have definitions which cover the relevant